import { GetPolicyListData } from "@/network/policy/model";
import { getPolicyList } from "@/network/policy/service";
import { Component } from "react";
import { Props, State } from "./model";
export default class Service extends Component<Props,State>{

    state: Readonly<State>={
        activeId:1,
        policyList:[]
    };

    setPolicyList=async (order:number)=>{
        const data =await getPolicyList({
            page:1,
            limit:6,
            keyWord:"",
            order,
            areaId:JSON.parse(localStorage.getItem("currentArea") as string).key
        })

        this.setState({
            policyList:data as GetPolicyListData
        })

    }


    componentWillMount=async()=>{
        this.setPolicyList(this.state.activeId);
    }
    
    
}